#ifndef UTILITIES_H
#define UTILITIES_H

#include "Vector.h"


#ifdef NDEBUG
    #define PRINT_DEBUG(msg)
#else
    #define PRINT_DEBUG(format, ...) \
        printf("%d : " format, __LINE__, ## __VA_ARGS__);
#endif


#define RADIANS(d) ((d)*0.01745329251994329577)
#define DEGREES(r) ((r)*57.2957795130823208768)


inline bool isZero(float v, float eps = 1e-9)
{ return (v > -eps) && (v < eps); }

inline bool areEqual(float a, float b, float eps = 1.e-5)
{ return (a-b > -eps) && (a-b < eps); }


inline Vector3f operator*(const Vector3f& v1, const Vector3f& v2)
{ return Vector3f(v1.x * v2.x, v1.y * v2.y, v1.z * v2.z); }


#endif // UTILITIES_H
